Mark strings in the source and in the templates as translatable.
We use the same extract-strings utility as for libgtk itself.
resources.h: inspector.gresource.xml
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/inspector.gresource.xml \
--target=$@ --sourcedir=$(srcdir) --c-name gtk_inspector --generate-header --manual-register
-resources.c: inspector.gresource.xml $(resource_files)
+resources.c: inspector.gresource.xml $(resource_files) $(template_headers)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/inspector.gresource.xml \
--target=$@ --sourcedir=$(srcdir) --c-name gtk_inspector --generate-source --manual-register
$(top_builddir)/gtk/libgtk-3.la \
$(GTK_DEP_LIBS)
-EXTRA_DIST= \
+templates = \
+ button-path.ui \
+ classes-list.ui \
+ css-editor.ui \
+ object-hierarchy.ui \
+ prop-list.ui \
+ themes.ui \
+ widget-tree.ui \
+ window.ui
+
+template_headers = $(templates:.ui=.ui.h)
+
+extract_strings = $(top_builddir)/gtk/extract-strings$(BUILD_EXEEXT)
+
+%.ui.h: %.ui $(extract_strings)
+ $(AM_V_GEN) $(extract_strings) $< > $@
+
+distclean-local:
+ if test $(srcdir) != .; then \
+ rm -f $(template_headers); \
+ fi
+
+EXTRA_DIST=
$(resource_files)
-include $(top_srcdir)/git.mk
<?xml version="1.0" encoding="UTF-8"?>
-<interface>
+<interface domain="gtk30">
<template class="GtkInspectorButtonPath" parent="GtkBox">
<property name="orientation">horizontal</property>
<child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Choose a widget through the inspector</property>
+ <property name="label" translatable="yes">Choose a widget through the inspector</property>
<property name="hexpand">True</property>
<property name="xalign">0.5</property>
</object>
* THE SOFTWARE.
*/
+#include "config.h"
+#include <glib/gi18n-lib.h>
#include "classes-list.h"
enum
{
GtkWidget *dialog, *content_area, *entry;
- dialog = gtk_dialog_new_with_buttons ("New class",
+ dialog = gtk_dialog_new_with_buttons (_("New class"),
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (cl))),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_USE_HEADER_BAR,
- "_OK", GTK_RESPONSE_OK,
- "Cancel", GTK_RESPONSE_CANCEL,
+ _("_OK"), GTK_RESPONSE_OK,
+ _("Cancel"), GTK_RESPONSE_CANCEL,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
entry = g_object_new (GTK_TYPE_ENTRY,
"visible", TRUE,
"margin", 5,
- "placeholder-text", "Class name",
+ "placeholder-text", _("Class name"),
"activates-default", TRUE,
NULL);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
<?xml version="1.0" encoding="UTF-8"?>
-<interface>
+<interface domain="gtk30">
<object class="GtkListStore" id="model">
<columns>
<column type="gboolean"/>
<object class="GtkToolButton">
<property name="visible">True</property>
<property name="icon-name">list-add</property>
- <property name="tooltip-text">Add a class</property>
+ <property name="tooltip-text" translatable="yes">Add a class</property>
<signal name="clicked" handler="add_clicked"/>
</object>
</child>
<object class="GtkToolButton">
<property name="visible">True</property>
<property name="icon-name">document-revert</property>
- <property name="tooltip-text">Restore defaults for this widget</property>
+ <property name="tooltip-text" translatable="yes">Restore defaults for this widget</property>
<signal name="clicked" handler="restore_defaults_clicked"/>
</object>
</child>
<property name="model">model</property>
<child>
<object class="GtkTreeViewColumn" id="column">
- <property name="title">Name</property>
+ <property name="title" translatable="yes">Name</property>
<child>
<object class="GtkCellRendererToggle">
<signal name="toggled" handler="enabled_toggled"/>
* THE SOFTWARE.
*/
+#include "config.h"
+#include <glib/gi18n-lib.h>
#include "css-editor.h"
#define GTK_INSPECTOR_CSS_EDITOR_TEXT "inspector-css-editor-text"
static void
set_initial_text (GtkInspectorCssEditor *editor)
{
- const gchar *initial_text_global =
- "/*\n"
- "You can type here any CSS rule recognized by GTK+.\n"
- "You can temporarily disable this custom CSS by clicking on the \"Pause\" button above.\n\n"
- "Changes are applied instantly and globally, for the whole application.\n"
- "*/\n\n";
- const gchar *initial_text_widget =
- "/*\n"
- "You can type here any CSS rule recognized by GTK+.\n"
- "You can temporarily disable this custom CSS by clicking on the \"Pause\" button above.\n\n"
- "Changes are applied instantly, only for this selected widget.\n"
- "*/\n\n";
const gchar *text = NULL;
if (editor->priv->selected_context)
text = g_object_get_data (G_OBJECT (editor->priv->selected_context), GTK_INSPECTOR_CSS_EDITOR_TEXT);
if (text)
gtk_text_buffer_set_text (GTK_TEXT_BUFFER (editor->priv->text), text, -1);
- else if (editor->priv->global)
- gtk_text_buffer_set_text (GTK_TEXT_BUFFER (editor->priv->text), initial_text_global, -1);
else
- gtk_text_buffer_set_text (GTK_TEXT_BUFFER (editor->priv->text), initial_text_widget, -1);
+ {
+ gchar *initial_text;
+ if (editor->priv->global)
+ initial_text = g_strconcat ("/*\n",
+ _("You can type here any CSS rule recognized by GTK+."), "\n",
+ _("You can temporarily disable this custom CSS by clicking on the \"Pause\" button above."), "\n\n",
+ _("Changes are applied instantly and globally, for the whole application."), "\n",
+ "*/\n\n", NULL);
+ else
+ initial_text = g_strconcat ("/*\n",
+ _("You can type here any CSS rule recognized by GTK+."), "\n",
+ _("You can temporarily disable this custom CSS by clicking on the \"Pause\" button above."), "\n\n",
+ _("Changes are applied instantly, only for this selected widget."), "\n",
+ "*/\n\n", NULL);
+ gtk_text_buffer_set_text (GTK_TEXT_BUFFER (editor->priv->text), initial_text, -1);
+ g_free (initial_text);
+ }
}
static void
<?xml version="1.0" encoding="UTF-8"?>
-<interface>
+<interface domain="gtk30">
<object class="GtkTextTagTable" id="tags">
<child type="tag">
<object class="GtkTextTag">
<object class="GtkToggleToolButton" id="disable_button">
<property name="visible">True</property>
<property name="icon-name">media-playback-pause</property>
- <property name="tooltip-text">Disable this custom CSS</property>
+ <property name="tooltip-text" translatable="yes">Disable this custom CSS</property>
<signal name="toggled" handler="disable_toggled"/>
</object>
</child>
* THE SOFTWARE.
*/
+#include "config.h"
+#include <glib/gi18n-lib.h>
#include "window.h"
#include "widget-tree.h"
GtkWidget *button;
button = gtk_button_new_from_icon_name ("edit-find", GTK_ICON_SIZE_BUTTON);
- gtk_widget_set_tooltip_text (button, "Inspect");
+ gtk_widget_set_tooltip_text (button, _("Inspect"));
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (on_inspect), iw);
return button;
<?xml version="1.0" encoding="UTF-8"?>
-<interface>
+<interface domain="gtk30">
<object class="GtkTreeStore" id="model">
<columns>
<column type="gchararray"/>
<property name="model">model</property>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Object Hierarchy</property>
+ <property name="title" translatable="yes">Object Hierarchy</property>
<child>
<object class="GtkCellRendererText">
<property name="scale">0.8</property>
<?xml version="1.0" encoding="UTF-8"?>
-<interface>
+<interface domain="gtk30">
<object class="GtkListStore" id="model">
<columns>
<column type="gchararray"/>
<property name="tooltip-column">4</property>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Property</property>
+ <property name="title" translatable="yes">Property</property>
<property name="resizable">True</property>
<property name="sort-order">ascending</property>
<property name="sort-column-id">0</property>
</child>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Value</property>
+ <property name="title" translatable="yes">Value</property>
<property name="resizable">True</property>
<child>
<object class="GtkInspectorPropertyCellRenderer" id="value_renderer">
</child>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Defined At</property>
+ <property name="title" translatable="yes">Defined At</property>
<child>
<object class="GtkCellRendererText">
<property name="scale">0.8</property>
<?xml version="1.0" encoding="UTF-8"?>
-<interface>
+<interface domain="gtk30">
<template class="GtkInspectorThemes" parent="GtkListBox">
<property name="selection-mode">none</property>
<child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Use dark variant</property>
+ <property name="label" translatable="yes">Use dark variant</property>
<property name="hexpand">True</property>
<property name="xalign">0.0</property>
</object>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">GTK+ Theme</property>
+ <property name="label" translatable="yes">GTK+ Theme</property>
<property name="hexpand">True</property>
<property name="xalign">0.0</property>
</object>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Icon Theme</property>
+ <property name="label" translatable="yes">Icon Theme</property>
<property name="hexpand">True</property>
<property name="xalign">0.0</property>
</object>
<?xml version="1.0" encoding="UTF-8"?>
-<interface>
+<interface domain="gtk30">
<object class="GtkTreeStore" id="model">
<columns>
<column type="gpointer"/>
</child>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Widget</property>
+ <property name="title" translatable="yes">Widget</property>
<property name="resizable">True</property>
<child>
<object class="GtkCellRendererText">
</child>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Name</property>
+ <property name="title" translatable="yes">Name</property>
<property name="resizable">True</property>
<child>
<object class="GtkCellRendererText">
</child>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Realized</property>
+ <property name="title" translatable="yes">Realized</property>
<child>
<object class="GtkCellRendererToggle">
<property name="activatable">True</property>
</child>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Mapped</property>
+ <property name="title" translatable="yes">Mapped</property>
<child>
<object class="GtkCellRendererToggle">
<property name="activatable">True</property>
</child>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Visible</property>
+ <property name="title" translatable="yes">Visible</property>
<child>
<object class="GtkCellRendererToggle">
<property name="activatable">True</property>
</child>
<child>
<object class="GtkTreeViewColumn">
- <property name="title">Address</property>
+ <property name="title" translatable="yes">Address</property>
<property name="resizable">True</property>
<child>
<object class="GtkCellRendererText">
* THE SOFTWARE.
*/
+#include "config.h"
+#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include "window.h"
#include "prop-list.h"
gtk_window_group_add_window (gtk_window_group_new (), GTK_WINDOW (iw));
- title = g_strdup_printf ("GTK+ Inspector — %s", g_get_application_name ());
+ title = g_strdup_printf (_("GTK+ Inspector — %s"), g_get_application_name ());
gtk_window_set_title (GTK_WINDOW (iw), title);
g_free (title);
<?xml version="1.0" encoding="UTF-8"?>
-<interface>
+<interface domain="gtk30">
<object class="GtkImage" id="update_image">
<property name="visible">True</property>
<property name="icon-name">view-refresh</property>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
- <property name="label">Send Widget to Shell</property>
+ <property name="label" translatable="yes">Send Widget to Shell</property>
<signal name="activate" handler="on_send_widget_to_shell_activate"/>
</object>
</child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="image">inspect_image</property>
- <property name="tooltip-text">Inspect</property>
+ <property name="tooltip-text" translatable="yes">Inspect</property>
<signal name="clicked" handler="on_inspect"/>
</object>
</child>
<object class="GtkToggleButton">
<property name="visible">True</property>
<property name="image">update_image</property>
- <property name="tooltip-text">Show Graphic Updates</property>
+ <property name="tooltip-text" translatable="yes">Show Graphic Updates</property>
<signal name="toggled" handler="on_graphic_updates_toggled"/>
</object>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Properties</property>
+ <property name="label" translatable="yes">Properties</property>
</object>
</child>
<child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Child Properties</property>
+ <property name="label" translatable="yes">Child Properties</property>
</object>
</child>
<child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Hierarchy</property>
+ <property name="label" translatable="yes">Hierarchy</property>
</object>
</child>
<child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">CSS Classes</property>
+ <property name="label" translatable="yes">CSS Classes</property>
</object>
</child>
<child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Custom CSS</property>
+ <property name="label" translatable="yes">Custom CSS</property>
</object>
</child>
</object>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Widget Tree</property>
+ <property name="label" translatable="yes">Widget Tree</property>
</object>
</child>
<child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Themes</property>
+ <property name="label" translatable="yes">Themes</property>
</object>
</child>
<child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label">Custom CSS</property>
+ <property name="label" translatable="yes">Custom CSS</property>
</object>
</child>
</object>
modules/input/imti-et.c
modules/input/imviqr.c
modules/input/imxim.c
+modules/inspector/classes-list.c
+modules/inspector/css-editor.c
+modules/inspector/inspect-button.c
+modules/inspector/window.c
+modules/inspector/button-path.ui.h
+modules/inspector/classes-list.ui.h
+modules/inspector/css-editor.ui.h
+modules/inspector/object-hierarchy.ui.h
+modules/inspector/prop-list.ui.h
+modules/inspector/themes.ui.h
+modules/inspector/widget-tree.ui.h
+modules/inspector/window.ui.h
modules/printbackends/cloudprint/gtkprintbackendcloudprint.c
modules/printbackends/cloudprint/gtkprintercloudprint.c
modules/printbackends/cups/gtkprintbackendcups.c